
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/modules/cms/front/include/taglib.jsp"%>
<!DOCTYPE html>
<html>
<head>
	<title>新闻列表</title>
	<meta name="decorator" content="cms_default_${site.theme}"/>
	<meta name="description" content="${category.description}" />
	<meta name="keywords" content="${category.keywords}" />
	<link rel="stylesheet" type="text/css" href="${ctxStatic}/IDH/css/news/news_list.css" />
	
</head>

<body>
	<form action="${ctx}/list-${category.id}${urlSuffix}?categoryId=${category.id}" method="post" name="orderFrm" id="orderFrm">
		<input type="hidden" id="statusSearch" name="updateDate"/>
    </form>
	<div class="col-md-10 col-md-offset-1 content ">
		<div class="row">
			<div class="col-lg-12">
				<div class="row">
					
					<ul class="nav nav-tabs col-lg-12" role="tablist" id="myTab">
						<li role="presentation" class="active">
							<a href="${ctx}/list-${category.id}${urlSuffix}">全部</a>
						</li>
						<!-- Single button -->
						<li role="presentation">
							<div class="btn-group">
								<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">日期
							    	<span class="caret"></span>
							    </button>
								<ul class="dropdown-menu" role="menu">
									<c:forEach items="${dateList}" var="datelist">
										<li onclick="getNewList(${datelist})">
										   <a href="#">${datelist}</a>
									    </li>
									</c:forEach>
								</ul>
							</div>
						</li>
					</ul>
				</div>
			</div>
			<c:if test="${category.module eq 'article'}">
				<c:forEach items="${page.list}" var="article">
				<input type="hidden" id="updateHidden" value="<fmt:formatDate value="${updateDateHidden}" pattern="yyyy-MM"/>" />
						<ul class="news_list_ul">
							<li class="col-md-12">
								<div class="new_list col-lg-12 col-xs-12">
									<div class="new_img col-lg-3 col-xs-4">
										<img src="${article.image}" />
									</div>
									<div class="new_info col-lg-9 col-xs-8">
										<a href="${article.url}"><h4>${fns:abbr(article.title,96)}</h4></a>
										<%-- <p class="character" id="character">${fn:substring(article.description,0,130)}${fn:length(article.description)>130?'...':''}</p> --%>
										<div class="character figcaption" id="character">
											<p>${article.description}</p>
										</div>
										<p class="time-date"><fmt:formatDate value="${article.updateDate}" pattern="yyyy-MM-dd" type="both"/><a href="${article.url}" class="detial">详细信息</a></p>
									</div>
								</div>
							</li>
						</ul>
					</c:forEach>
				<div class="pagination">${page}</div>
				<script type="text/javascript">
					 function page(n, s) {
						 var updateDate = $("#updateHidden").val();
						 if(updateDate!=undefined&&updateDate!=""){
							 updateDate=$("#updateHidden").val();
							 location = "${ctx}/list-${category.id}${urlSuffix}?pageNo=" + n + "&pageSize=" + s+"&updateDate="+updateDate;
						 }else{
							 location = "${ctx}/list-${category.id}${urlSuffix}?pageNo=" + n + "&pageSize=" + s;
						 }
						
					} 
				</script>
			</c:if>
			<c:if test="${category.module eq 'link'}">
				<ul>
					<c:forEach items="${page.list}" var="link">
						<li>
							<a href="${link.href}" target="_blank" style="color:${link.color}">
								<c:out value="${link.title}" />
							</a>
						</li>
					</c:forEach>
				</ul>
			</c:if>
		</div> 
		
		<div class="tab-content">
			<div role="tabpanel" class="tab-pane active" id="all_news">
				<c:if test="${category.module eq 'article'}">
					
				</c:if>

			</div>
		</div>
	</div>
<script type="text/javascript">
	$(".figcaption").each(function(i){
	    var divH = $(this).height();
	    var $p = $("p", $(this)).eq(0);
	    while ($p.outerHeight() > divH) {
	        $p.text($p.text().replace(/(\s)*([a-zA-Z0-9]+|\W)(\.\.\.)?$/, "..."));
	    };
	});
	function getNewList(date){
		$("#statusSearch").val(date);
		
		$("#orderFrm").submit();
	}
</script>
</body>

</html>